package com.bt.mes.common.util;


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

import org.springframework.stereotype.Component;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

//@Component
public class PaseXML {
	//TODO Use FileInputStream
	private static XStream xstream ;
//	private static String strXMLRootPath = "C:/OPITRDAT4/web/";
	
	static{
		xstream = new XStream(new DomDriver());//new DomDriver("utf-8")
//		xstream.autodetectAnnotations(true);
	}
	
//	private static String getInTrxStr(String strTxID){
////		String strXMLRootPath = "C:/OPITRDAT4/C1008010/";
//		String strXMLFilePath  = null;
//		String strIxTrx = "";
//		
//		strXMLFilePath = strXMLRootPath + strTxID + ".xml";
//		File inTrxFile=new File(strXMLFilePath);
//	    try{
//            BufferedReader in = new BufferedReader(new FileReader(inTrxFile));
//            String strTemp;
//            while ((strTemp = in.readLine()) != null){
//            	strIxTrx += strTemp;
//            }
//            in.close();
//        }catch (IOException e){
//            e.getStackTrace();
//        } 
//	    
//		return strIxTrx;
//	}
	
//	public static Object getITrxObj(Object inObj){
//		Object objIn = null;
//    	String strIxTrx = null;
//    	strIxTrx = getInTrxStr(inObj.getClass().getSimpleName().toString().toUpperCase());
//    	xstream.processAnnotations(inObj.getClass());
//		objIn = xstream.fromXML(strIxTrx);
//		 
//		return objIn;
//	}

}
